package ibm.websphere.monitor.domain;

import java.util.List;

import ibm.websphere.monitor.bean.MenuInfo;
import ibm.websphere.monitor.common.HibernateDaoHelper;
import org.springframework.stereotype.Repository;


/**
 * <pre>
 * @Description 菜单操作的DOMAIN
 * </pre>
 *
 * @copyright www.timotai.net
 * @author 这家伙真懒
 * @date 2016-1-12
 */
@Repository
public class MenuDomain extends HibernateDaoHelper<MenuInfo> {



	/**
	 * <pre>
	 * 	根据父类ID查询该ID 下的所有菜单对象
	 * </pre>
	 * @param fatherId
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<MenuInfo> findFatherMenu(Long fatherId) {
		return this.findByProperty("menuPid", fatherId, "menuSort");
	}



	@SuppressWarnings("unchecked")
	public MenuInfo findMenuById(Long menuId) {
		return this.findOneByProperty("menuId", menuId);
	}


	/**
	 *
	 * @return
	 */
	public List<?> getRoleRightList(){
		return this.findAll();
	}

}
